package schemax

import "gitee.com/zhongguo168a/gocodes/datax/schemax/basickind"

func init() {
	list := []IDecl{
		&ClassDecl{
			Namespace: "",
			Name:      "classdecl",
			Parent:    "",
			Fields: []*Field{
				{Name: "Namespace", Type: &BasicType{Kind: basickind.String}},
				{Name: "Name", Type: &BasicType{Kind: basickind.String}},
				{Name: "Comments", Type: &ArrayType{Elem: &BasicType{Kind: basickind.String}}},
				{Name: "Parent", Type: &BasicType{Kind: basickind.String}},
				{Name: "Fields", Type: &ArrayType{Elem: &ClassType{Decl: "field"}}},
				{Name: "Tags", Type: &MapType{Key: &BasicType{Kind: basickind.String}, Value: &BasicType{Kind: basickind.String}}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "enumdecl",
			Parent:    "",
			Fields: []*Field{
				{Name: "Namespace", Type: &BasicType{Kind: basickind.String}},
				{Name: "Name", Type: &BasicType{Kind: basickind.String}},
				{Name: "Comments", Type: &ArrayType{Elem: &BasicType{Kind: basickind.String}}},
				{Name: "Kind", Type: &EnumType{Decl: "kind"}},
				{Name: "Fields", Type: &ArrayType{Elem: &ClassType{Decl: "field"}}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "interface",
			Parent:    "",
			Fields: []*Field{
				{Name: "Namespace", Type: &BasicType{Kind: basickind.String}},
				{Name: "Name", Type: &BasicType{Kind: basickind.String}},
				{Name: "Comments", Type: &ArrayType{Elem: &BasicType{Kind: basickind.String}}},
				{Name: "Kind", Type: &EnumType{Decl: "kind"}},
				{Name: "Fields", Type: &ArrayType{Elem: &ClassType{Decl: "field"}}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "field",
			Parent:    "",
			Fields: []*Field{
				{Name: "Name", Type: &BasicType{Kind: basickind.String}},
				{Name: "Comments", Type: &ArrayType{Elem: &BasicType{Kind: basickind.String}}},
				{Name: "Type", Type: &AnyType{}},
				{Name: "Value", Type: &BasicType{Kind: basickind.String}},
				{Name: "Tags", Type: &MapType{Key: &BasicType{Kind: basickind.String}, Value: &BasicType{Kind: basickind.String}}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "class",
			Parent:    "",
			Fields: []*Field{
				{Name: "Decl", Type: &BasicType{Kind: basickind.String}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "enum",
			Parent:    "",
			Fields: []*Field{
				{Name: "Decl", Type: &BasicType{Kind: basickind.String}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "map",
			Parent:    "",
			Fields: []*Field{
				{Name: "Key", Type: &AnyType{}},
				{Name: "Value", Type: &AnyType{}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "func",
			Parent:    "",
			Fields: []*Field{
				{Name: "Args", Type: &ArrayType{Elem: &AnyType{}}},
				{Name: "Results", Type: &ArrayType{Elem: &AnyType{}}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "array",
			Parent:    "",
			Fields: []*Field{
				{Name: "Elem", Type: &AnyType{}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "basic",
			Parent:    "",
			Fields: []*Field{
				{Name: "Kind", Type: &EnumType{Decl: "kind"}},
			},
		},
		&ClassDecl{
			Namespace: "",
			Name:      "any",
			Parent:    "",
			Fields:    []*Field{},
		},
		&EnumDecl{
			Namespace: "",
			Name:      "kind",
			Kind:      int(basickind.Int8),
			Fields: []*Field{
				{Name: "Invalid", Value: "1"},
				{Name: "Bool", Value: "2"},
				{Name: "Int8", Value: "3"},
				{Name: "Int16", Value: "4"},
				{Name: "Int32", Value: "5"},
				{Name: "Int64", Value: "6"},
				{Name: "Uint8", Value: "7"},
				{Name: "Uint16", Value: "8"},
				{Name: "Uint32", Value: "9"},
				{Name: "Uint64", Value: "10"},
				{Name: "Float32", Value: "11"},
				{Name: "Float64", Value: "12"},
				{Name: "String", Value: "13"},
			},
		},
	}

	_ = AddDecls(list)
}
